package com.start.admin.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.start.common.constant.StartConstant;
import com.start.common.dic.DictMapper;
import com.start.common.entity.StartBaseUser;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper = true)
@TableName("start_sys_user")
public class StartSysUser extends StartBaseUser {

    @Schema(name = "所在组织机构id")
    @DictMapper(value = "所在组织机构", mapperTable = "start_sys_dept", mapperLabel = "name", mapperValue = "id")
    private String deptId;
    @Schema(name = "邮箱")
    @DictMapper("邮箱")
    private String email;
    @DictMapper("电话")
    @Schema(name = "电话")
    private String phone;
    @DictMapper("QQ")
    @Schema(name = "QQ")
    private String qq;

    @Schema(name = "职务")
    @DictMapper(value = "职务", mapperTable = "start_sys_dept_job", mapperLabel = "name", mapperValue = "id")
    private String deptJobId;
    @Schema(name = "备注")
    @DictMapper("备注")
    private String remarks;

    @Override
    public String getStartUserType() {
        return StartConstant.ClientUserType.ADMIN_USER;
    }

    /**
     * 获取用户key 标准 用户体系:用户id 如：admin_user:123456dasfd
     *
     * @return
     */
    @Override
    public String getStartUserKey() {
        return getStartUserType() + ":" + this.getId();
    }
}
